Repository navigation
feat(ui): let a scroll area draw its bars with the product's own geometry - #12
Merged
Merged
Conversation
…etry ScrollArea.Bars hands a components.ScrollBarStyle to the area's own state, which the paint of the bars reads, so a product drawing eleven point tracks with five point thumbs sets that once per area instead of living with Viva's ten and six. The zero style keeps Viva's geometry, so nothing changes for a page that never asks for its own bars. The init guide lists the method. Tests check that the style reaches the area's state and that an area without one keeps the zero style. Co-Authored-By: AtomCode (deepseek-v4.1-flash) <noreply@atomgit.com>
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这个 PR 做什么
components.ScrollBarStyle上一步只到了components.ScrollArea,而应用用的ui.List、ui.Tree、ui.Scroll都由ui内部构造滚动区,应用拿不到那个参数。这次把它透出来:Box.Bars(components.ScrollBarStyle):把样式写进该区域的ScrollState,paintScrollbars构造滚动区时应用它。cmd/viva/initfiles/AGENTS.md.txt)补了.Bars(...)说明,ui的指南校验要求每个导出方法都被列出。测试
ui/scroll_bars_test.go:components.ScrollBarStylego test ./ui/ ./components/ ./gfx/通过。